package com.lightdz.tshirtdz.controller;

import com.lightdz.tshirtdz.bll.FavoriteBll;
import com.lightdz.tshirtdz.bll.OrderBll;
import com.lightdz.tshirtdz.model.api.ApiResponse;
import com.lightdz.tshirtdz.model.api.ApiShoppingCar;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ Description：我的订单
 * @ Author     ：zbl
 * @ Date       ：Created in 16:39 09/08/2018
 * @ Modified By：
 */

@RequestMapping(value = "/order")
@RestController
public class OrderController {

    @Autowired
    OrderBll orderBll;

    /**
     * 删除我的订单
     *
     */
    @GetMapping(value = "/deleteorder")
    public ApiResponse<Boolean> deleteOrder(String wxId, long orderId) {
        return orderBll.deleteOrder(wxId, orderId);
    }

    /**
     * 获取我的订单
     *
     * @param wxId
     * @return
     */
    @GetMapping(value = "/getorderlist")
    public ApiResponse<List<ApiShoppingCar>> getOrderList(String wxId) {
        return orderBll.getOrderList(wxId);
    }

    @GetMapping(value = "/addOrder")
    public ApiResponse<Boolean> addOrder(String wxId, long pid, int pCount,String pSize,String pColor,long receiveAddrId){

       return  orderBll.addOrder(wxId,pid,pCount,pSize,pColor,receiveAddrId);
    }
}
